new Vue({
  el: '#app',
  data() {
    return {
      tableData: [],
      form: {
        Data: "other_service_detail",
        page: 1,
        limit: 5,
        Primary_Key: "2",
        Primary_Key_Name: "Other_Service_Type"
      },
      total: 0,
    }
  },
  mounted() {
    this.getTables(this.form)
  },
  methods: {
    addEnterprise() {
      window.location.href = './Add.html'
    },
    handleSizeChange(val) {
      this.form.page = 1;
      this.form.limit = val;
      this.getList(this.form)
    },
    handleCurrentChange(val) {
      this.form.page = val;
      this.getList(this.form)
    },
    getTables(data) {
      const _this = this;
      $.ajax({
        url: DomainName + '/getTableInquiryAction?token=' + $.cookie("token"),
        type: 'POST',
        data,
        success: function (res) {
          // console.log(res.tableData);
          _this.tableData = res.tableData
          _this.total = res.tableData.length;
          console.log(_this.tableData);
        },
        error: function () {
          _this.$message.error("操作失败，请稍后再试")
        },
        complete: function (XMLHttpRequest) {
          if (XMLHttpRequest.getResponseHeader("REDIRECT") == "REDIRECT") {
            window.parent.document.location.href = "../../../" + XMLHttpRequest.getResponseHeader("CONTENTPATH");
          }
        }
      })
    },
  },
})